﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
namespace QuanLyKhachSan
{
    /// <summary>
    /// 
    /// </summary>
    public partial class UC_Phong_TheoTinhTrang : System.Web.UI.UserControl
    {
        private int PhongID = 0;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                dlPhong.ItemDataBound += new DataListItemEventHandler(dlPhong_ItemDataBound);
                Phong_TinhTrang_Load();             
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
        }

        void dlPhong_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            //if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            //{
            //    e.Item.BackColor = System.Drawing.Color.AliceBlue;
            //}
        }

        /// <summary>
        /// 
        /// </summary>
        protected void Phong_TinhTrang_Load()
        {
            try
            {
                dlPhong.DataSource = PhongBLL.Phong_GetItems_ByTinhTrang();
                dlPhong.DataBind();
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
        }
        public string ContextMenu(string PhongID,string TinhTrangPhongID)
        {
            if (TinhTrangPhongID == "1")
            {
                return "TinyMenu" + "_" + PhongID + "_" + TinhTrangPhongID;
            }
            else
            {
                return "FullMenu" + "_" +  PhongID + "_" + TinhTrangPhongID;
            }
        }
    }
}